#### Recode values to prepare for estimation
#### Jonne Kamphorst
#### February 2021



#### Load libraries and data ####
library(dplyr)
library(tidyverse)
library(gdata) #for keep

all_data <- readRDS("data/final_data_wide_all.rds")






#### Recode and rename variables ####
## Rename variables from agreement ##
all_data <- all_data %>% rename(force_immi = QPT1.1_1,
                                force_eu = QPT1.1_2,
                                force_climate = QPT1.1_3,
                                force_lgbt = QPT1.1_4,
                                force_wage = QPT1.1_5,
                                force_farms = QPT1.1_6)


## Rename QV variables ##
all_data <- all_data %>% rename(QV_immi = QV1,
                                QV_wage = QV2,
                                QV_eu = QV3,
                                QV_climate = QV4,
                                QV_farms = QV5,
                                QV_lgbt = QV6)





# Create absolute values from QV variables
all_data$QV_immi_abs <- abs(all_data$QV_immi)
all_data$QV_wage_abs <- abs(all_data$QV_wage)
all_data$QV_eu_abs <- abs(all_data$QV_eu)
all_data$QV_climate_abs <- abs(all_data$QV_climate)
all_data$QV_farms_abs <- abs(all_data$QV_farms)
all_data$QV_lgbt_abs <- abs(all_data$QV_lgbt)



#### Remove people who did not understand the QV task ####
## Check how many credits people used
all_data$credits <- (all_data$QV_immi_abs)^2 +
  (all_data$QV_wage_abs)^2 +
  (all_data$QV_eu_abs)^2 +
  (all_data$QV_climate_abs)^2 +
  (all_data$QV_farms_abs)^2 +
  (all_data$QV_lgbt_abs)^2

table(all_data$credits)
mean(all_data$credits)







# remove people with inconsistencies between forced choice and QV
all_data$wrongly_understood_qv <- 0

all_data$wrongly_understood_qv[all_data$QV_wage > 0 & all_data$force_wage == "Oneens"] <- all_data$wrongly_understood_qv[all_data$QV_wage > 0 & all_data$force_wage == "Oneens"] + 1
all_data$wrongly_understood_qv[all_data$QV_wage < 0 & all_data$force_wage == "Eens"] <- all_data$wrongly_understood_qv[all_data$QV_wage < 0 & all_data$force_wage == "Eens"] + 1

all_data$wrongly_understood_qv[all_data$QV_eu > 0 & all_data$force_eu == "Oneens"] <- all_data$wrongly_understood_qv[all_data$QV_eu > 0 & all_data$force_eu == "Oneens"] + 1
all_data$wrongly_understood_qv[all_data$QV_eu < 0 & all_data$force_eu == "Eens"] <- all_data$wrongly_understood_qv[all_data$QV_eu < 0 & all_data$force_eu == "Eens"] + 1

all_data$wrongly_understood_qv[all_data$QV_climate > 0 & all_data$force_climate == "Oneens"] <- all_data$wrongly_understood_qv[all_data$QV_climate > 0 & all_data$force_climate == "Oneens"] + 1
all_data$wrongly_understood_qv[all_data$QV_climate < 0 & all_data$force_climate == "Eens"] <- all_data$wrongly_understood_qv[all_data$QV_climate < 0 & all_data$force_climate == "Eens"] + 1

all_data$wrongly_understood_qv[all_data$QV_immi > 0 & all_data$force_immi == "Oneens"] <- all_data$wrongly_understood_qv[all_data$QV_immi > 0 & all_data$force_immi == "Oneens"]  + 1
all_data$wrongly_understood_qv[all_data$QV_immi < 0 & all_data$force_immi == "Eens"] <- all_data$wrongly_understood_qv[all_data$QV_immi < 0 & all_data$force_immi == "Eens"] + 1

all_data$wrongly_understood_qv[all_data$QV_farms > 0 & all_data$force_farms == "Oneens"] <- all_data$wrongly_understood_qv[all_data$QV_farms > 0 & all_data$force_farms == "Oneens"] + 1
all_data$wrongly_understood_qv[all_data$QV_farms < 0 & all_data$force_farms == "Eens"] <- all_data$wrongly_understood_qv[all_data$QV_farms < 0 & all_data$force_farms == "Eens"] + 1

all_data$wrongly_understood_qv[all_data$QV_lgbt > 0 & all_data$force_lgbt == "Oneens"] <- all_data$wrongly_understood_qv[all_data$QV_lgbt > 0 & all_data$force_lgbt == "Oneens"] + 1
all_data$wrongly_understood_qv[all_data$QV_lgbt < 0 & all_data$force_lgbt == "Eens"] <- all_data$wrongly_understood_qv[all_data$QV_lgbt < 0 & all_data$force_lgbt == "Eens"]  + 1

table(all_data$wrongly_understood_qv)

#remove respondents with too many inconsistencies
all_data <- subset(all_data, wrongly_understood_qv < 3)




#### continue recoding ####

## Rename thermostat variables ##
all_data <- all_data %>% rename(therm_vvd = Q3.3,
                                therm_pvv = Q3.4,
                                therm_cda = Q3.5,
                                therm_d66 = Q3.6,
                                therm_gl = Q3.7,
                                therm_sp = Q3.8,
                                therm_pvda = Q3.9,
                                therm_fvd = Q3.10,
                                therm_cu = Q3.11,
                                therm_denk = Q3.12,
                                therm_sgp = Q3.13,
                                elec_today = Q2.1)

therms <- c("therm_vvd", "therm_pvv", "therm_cda", "therm_d66", "therm_gl",
            "therm_sp", "therm_pvda", "therm_fvd", "therm_cu", "therm_denk", "therm_sgp")

#change values in all columns to numeric
all_data <- all_data %>% mutate_at(therms, 
                                   ~as.numeric(recode(.,
                                                      "Zeer onsympathiek: 0"=0, 
                                                      "1"=1,
                                                      "2"=2,
                                                      "3"=3,
                                                      "4"=4,
                                                      "5"=5,
                                                      "6"=6,
                                                      "7"=7,
                                                      "8"=8,
                                                      "9"=9,
                                                      "Zeer sympathiek: 10"=10,
                                                      "Weet ik niet"=-99))) #change to -99 if you want to drop these people!

#change the 99 to NA
all_data <- all_data %>% dplyr::na_if(-99)



# change party names #
all_data$Partij <- as.character(all_data$Partij)
all_data$Partij[all_data$Partij == "CDA (Christen Democratisch Appel)"] <- "CDA"
all_data$Partij[all_data$Partij == "VVD (Volkspartij voor Vrijheid en Democratie)"] <- "VVD"
all_data$Partij[all_data$Partij == "SP (Socialistische Partij)"] <- "SP"
all_data$Partij[all_data$Partij == "PvdA (Partij van de Arbeid)"] <- "PvdA"
all_data$Partij[all_data$Partij == "PVV (Partij Voor de Vrijheid)"] <- "PVV"
all_data$Partij[all_data$Partij == "GL (Groen Links)"] <- "GL"


all_data$elec_today <- as.character(all_data$elec_today)
all_data$elec_today[all_data$elec_today == "GroenLinks"] <- "GL"




#### Change the salience variables ####
all_data$QV_immi_abs_dummies[all_data$QV_immi_abs >= 0 & all_data$QV_immi_abs <= 1] <- "Low" # 0 - 0
all_data$QV_immi_abs_dummies[all_data$QV_immi_abs >= 2 & all_data$QV_immi_abs <= 3] <- "Medium" # 1- 3
all_data$QV_immi_abs_dummies[all_data$QV_immi_abs >= 4 & all_data$QV_immi_abs <= 6] <- "High" # 4 - 6

all_data$QV_wage_abs_dummies[all_data$QV_wage_abs >= 0 & all_data$QV_wage_abs <= 1] <- "Low" # 0 - 0
all_data$QV_wage_abs_dummies[all_data$QV_wage_abs >= 2 & all_data$QV_wage_abs <= 3] <- "Medium" # 1- 3
all_data$QV_wage_abs_dummies[all_data$QV_wage_abs >= 4 & all_data$QV_wage_abs <= 6] <- "High" # 4 - 6

all_data$QV_eu_abs_dummies[all_data$QV_eu_abs >= 0 & all_data$QV_eu_abs <= 1] <- "Low" # 0 - 0
all_data$QV_eu_abs_dummies[all_data$QV_eu_abs >= 2 & all_data$QV_eu_abs <= 3] <- "Medium" # 1- 3
all_data$QV_eu_abs_dummies[all_data$QV_eu_abs >= 4 & all_data$QV_eu_abs <= 6] <- "High" # 4 - 6

all_data$QV_climate_abs_dummies[all_data$QV_climate_abs >= 0 & all_data$QV_climate_abs <= 1] <- "Low" # 0 - 0
all_data$QV_climate_abs_dummies[all_data$QV_climate_abs >= 2 & all_data$QV_climate_abs <= 3] <- "Medium" # 1- 3
all_data$QV_climate_abs_dummies[all_data$QV_climate_abs >= 4 & all_data$QV_climate_abs <= 6] <- "High" # 4 - 6

all_data$QV_farms_abs_dummies[all_data$QV_farms_abs >= 0 & all_data$QV_farms_abs <= 1] <- "Low" # 0 - 0
all_data$QV_farms_abs_dummies[all_data$QV_farms_abs >= 2 & all_data$QV_farms_abs <= 3] <- "Medium" # 1- 3
all_data$QV_farms_abs_dummies[all_data$QV_farms_abs >= 4 & all_data$QV_farms_abs <= 6] <- "High" # 4 - 6

all_data$QV_lgbt_abs_dummies[all_data$QV_lgbt_abs >= 0 & all_data$QV_lgbt_abs <= 1] <- "Low" # 0 - 0
all_data$QV_lgbt_abs_dummies[all_data$QV_lgbt_abs >= 2 & all_data$QV_lgbt_abs <= 3] <- "Medium" # 1- 3
all_data$QV_lgbt_abs_dummies[all_data$QV_lgbt_abs >= 4 & all_data$QV_lgbt_abs <= 6] <- "High" # 4 - 6

all_data$QV_immi_abs_dummies <- factor(all_data$QV_immi_abs_dummies, levels=c("Low", "Medium", "High"))
all_data$QV_wage_abs_dummies <- factor(all_data$QV_wage_abs_dummies, levels=c("Low", "Medium", "High"))
all_data$QV_eu_abs_dummies <- factor(all_data$QV_eu_abs_dummies, levels=c("Low", "Medium", "High"))
all_data$QV_climate_abs_dummies <- factor(all_data$QV_climate_abs_dummies, levels=c("Low", "Medium", "High"))
all_data$QV_farms_abs_dummies <- factor(all_data$QV_farms_abs_dummies, levels=c("Low", "Medium", "High"))
all_data$QV_lgbt_abs_dummies <- factor(all_data$QV_lgbt_abs_dummies, levels=c("Low", "Medium", "High"))




#### Change the strategies to align with agree or disagree with a voter####
# Ambiguity first
all_data$EU <- as.character(all_data$EU)
all_data$wage <- as.character(all_data$wage)
all_data$farms <- as.character(all_data$farms)
all_data$immi <- as.character(all_data$immi)
all_data$lgbt <- as.character(all_data$lgbt)
all_data$climate <- as.character(all_data$climate)

all_data$immi[all_data$immi == "Schengen kan in gevaar komen of niet maar solidariteit is een fundamentele afspraak binnen Schengen"] <- "Ambiguity"
all_data$farms[all_data$farms == "We toetsen planologische regels voor de bouw van zeer grote stallen op volksgezondheidsaspecten. Waar nodig worden de regels aangescherpt"] <- "Ambiguity"
all_data$climate[all_data$climate == "Er is natuurlijk ook wel een klimaatprobleem maar mensen die dat ontkennen mogen dat"] <- "Ambiguity"
all_data$lgbt[all_data$lgbt == "Scholen zijn wettelijk verplicht zorg te dragen voor de sociale psychische en fysieke veiligheid van alle leerlingen"] <- "Ambiguity"
all_data$wage[all_data$wage == "In de huidige situatie moeten we ons volledig focussen on het beteugelen van een recessie en het behouden van zoveel mogelijk banen. Er is voeding voor een debat"] <- "Ambiguity"
all_data$EU[all_data$EU == "Ik ben trots op democratie en zal de resultaten van een referendum accepteren"] <- "Ambiguity"


##  Then whether a voter agrees or disagrees with a party
#EU
all_data$EU_recoded <- all_data$EU
all_data$EU_recoded[all_data$EU_recoded == "Wij zijn een voorstander van een referendum over de EU" & all_data$QV_eu > 0] <- "Agree"
all_data$EU_recoded[all_data$EU_recoded == "Wij zijn een voorstander van een referendum over de EU" & all_data$QV_eu == 0 & all_data$force_eu == "Eens"] <- "Agree"
all_data$EU_recoded[all_data$EU_recoded == "Er moet geen referendum komen" & all_data$QV_eu < 0] <- "Agree"
all_data$EU_recoded[all_data$EU_recoded == "Er moet geen referendum komen" & all_data$QV_eu == 0 & all_data$force_eu == "Oneens"] <- "Agree"

all_data$EU_recoded[all_data$EU_recoded == "Wij zijn een voorstander van een referendum over de EU" & all_data$QV_eu < 0] <- "Disagree"
all_data$EU_recoded[all_data$EU_recoded == "Wij zijn een voorstander van een referendum over de EU" & all_data$QV_eu == 0 & all_data$force_eu == "Oneens"] <- "Disagree"
all_data$EU_recoded[all_data$EU_recoded == "Er moet geen referendum komen" & all_data$QV_eu > 0] <- "Disagree"
all_data$EU_recoded[all_data$EU_recoded == "Er moet geen referendum komen" & all_data$QV_eu == 0 & all_data$force_eu == "Eens"] <- "Disagree"


#immi
all_data$immi_recoded <- all_data$immi
all_data$immi_recoded[all_data$immi_recoded == "We moeten migranten toelaten" & all_data$QV_immi > 0] <- "Agree"
all_data$immi_recoded[all_data$immi_recoded == "We moeten migranten toelaten" & all_data$QV_immi == 0 & all_data$force_immi == "Eens"] <- "Agree"
all_data$immi_recoded[all_data$immi_recoded == "We moeten immigratie stoppen" & all_data$QV_immi < 0] <- "Agree"
all_data$immi_recoded[all_data$immi_recoded == "We moeten immigratie stoppen" & all_data$QV_immi == 0 & all_data$force_immi == "Oneens"] <- "Agree" 

all_data$immi_recoded[all_data$immi_recoded == "We moeten migranten toelaten" & all_data$QV_immi < 0] <- "Disagree"
all_data$immi_recoded[all_data$immi_recoded == "We moeten migranten toelaten" & all_data$QV_immi == 0 & all_data$force_immi == "Oneens"] <- "Disagree"
all_data$immi_recoded[all_data$immi_recoded == "We moeten immigratie stoppen" & all_data$QV_immi > 0] <- "Disagree"
all_data$immi_recoded[all_data$immi_recoded == "We moeten immigratie stoppen" & all_data$QV_immi == 0 & all_data$force_immi == "Eens"] <- "Disagree" 


#wage
all_data$wage_recoded <- all_data$wage
all_data$wage_recoded[all_data$wage_recoded == "Wij komen met een wetsvoorstel voor een hoger minimumloon" & all_data$QV_wage > 0] <- "Agree"
all_data$wage_recoded[all_data$wage_recoded == "Wij komen met een wetsvoorstel voor een hoger minimumloon" & all_data$QV_wage == 0 & all_data$force_wage == "Eens"] <- "Agree"
all_data$wage_recoded[all_data$wage_recoded == "Het minimumloon moet niet omhoog" & all_data$QV_wage < 0] <- "Agree"
all_data$wage_recoded[all_data$wage_recoded == "Het minimumloon moet niet omhoog" & all_data$QV_wage == 0 & all_data$force_wage == "Oneens"] <- "Agree"

all_data$wage_recoded[all_data$wage_recoded == "Wij komen met een wetsvoorstel voor een hoger minimumloon" & all_data$QV_wage < 0] <- "Disagree"
all_data$wage_recoded[all_data$wage_recoded == "Wij komen met een wetsvoorstel voor een hoger minimumloon" & all_data$QV_wage == 0 & all_data$force_wage == "Oneens"] <- "Disagree"
all_data$wage_recoded[all_data$wage_recoded == "Het minimumloon moet niet omhoog" & all_data$QV_wage > 0] <- "Disagree"
all_data$wage_recoded[all_data$wage_recoded == "Het minimumloon moet niet omhoog" & all_data$QV_wage == 0 & all_data$force_wage == "Eens"] <- "Disagree"


#lgbtq
all_data$lgbt_recoded <- all_data$lgbt
all_data$lgbt_recoded[all_data$lgbt_recoded == "Homoseksualiteit afkeuren mag" & all_data$QV_lgbt > 0] <- "Agree"
all_data$lgbt_recoded[all_data$lgbt_recoded == "Homoseksualiteit afkeuren mag" & all_data$QV_lgbt == 0 & all_data$force_lgbt == "Eens"] <- "Agree"
all_data$lgbt_recoded[all_data$lgbt_recoded == "Scholen mogen homoseksualiteit niet afkeuren" & all_data$QV_lgbt < 0] <- "Agree"
all_data$lgbt_recoded[all_data$lgbt_recoded == "Scholen mogen homoseksualiteit niet afkeuren" & all_data$QV_lgbt == 0 & all_data$force_lgbt == "Oneens"] <- "Agree"

all_data$lgbt_recoded[all_data$lgbt_recoded == "Homoseksualiteit afkeuren mag" & all_data$QV_lgbt < 0] <- "Disagree"
all_data$lgbt_recoded[all_data$lgbt_recoded == "Homoseksualiteit afkeuren mag" & all_data$QV_lgbt == 0 & all_data$force_lgbt == "Oneens"] <- "Disagree"
all_data$lgbt_recoded[all_data$lgbt_recoded == "Scholen mogen homoseksualiteit niet afkeuren" & all_data$QV_lgbt > 0] <- "Disagree"
all_data$lgbt_recoded[all_data$lgbt_recoded == "Scholen mogen homoseksualiteit niet afkeuren" & all_data$QV_lgbt == 0 & all_data$force_lgbt == "Eens"] <- "Disagree"


#farms
all_data$farms_recoded <- all_data$farms
all_data$farms_recoded[all_data$farms_recoded == "We moeten stoppen met de megastallen" & all_data$QV_farms > 0] <- "Agree"
all_data$farms_recoded[all_data$farms_recoded == "We moeten stoppen met de megastallen" & all_data$QV_farms == 0 & all_data$force_farms == "Eens"] <- "Agree"
all_data$farms_recoded[all_data$farms_recoded == "Megastallen mogen" & all_data$QV_farms < 0] <- "Agree"
all_data$farms_recoded[all_data$farms_recoded == "Megastallen mogen" & all_data$QV_farms == 0 & all_data$force_farms == "Oneens"] <- "Agree"

all_data$farms_recoded[all_data$farms_recoded == "We moeten stoppen met de megastallen" & all_data$QV_farms < 0] <- "Disagree"
all_data$farms_recoded[all_data$farms_recoded == "We moeten stoppen met de megastallen" & all_data$QV_farms == 0 & all_data$force_farms == "Oneens"] <- "Disagree"
all_data$farms_recoded[all_data$farms_recoded == "Megastallen mogen" & all_data$QV_farms > 0] <- "Disagree"
all_data$farms_recoded[all_data$farms_recoded == "Megastallen mogen" & all_data$QV_farms == 0 & all_data$force_farms == "Eens"] <- "Disagree"



#climate
all_data$climate_recoded <- all_data$climate
all_data$climate_recoded[all_data$climate_recoded == "We moeten snel in actie komen" & all_data$QV_climate > 0] <- "Agree"
all_data$climate_recoded[all_data$climate_recoded == "We moeten snel in actie komen" & all_data$QV_climate == 0 & all_data$force_climate == "Eens"] <- "Agree"
all_data$climate_recoded[all_data$climate_recoded == "We hoeven niet snel in actie te komen" & all_data$QV_climate < 0] <- "Agree"
all_data$climate_recoded[all_data$climate_recoded == "We hoeven niet snel in actie te komen" & all_data$QV_climate == 0 & all_data$force_climate == "Oneens"] <- "Agree"

all_data$climate_recoded[all_data$climate_recoded == "We moeten snel in actie komen" & all_data$QV_climate < 0] <- "Disagree"
all_data$climate_recoded[all_data$climate_recoded == "We moeten snel in actie komen" & all_data$QV_climate == 0 & all_data$force_climate == "Oneens"] <- "Disagree"
all_data$climate_recoded[all_data$climate_recoded == "We hoeven niet snel in actie te komen" & all_data$QV_climate > 0] <- "Disagree"
all_data$climate_recoded[all_data$climate_recoded == "We hoeven niet snel in actie te komen" & all_data$QV_climate == 0 & all_data$force_climate == "Eens"] <- "Disagree"






#### Add partisanship ####
## Create a variable for co-partisan or not
all_data$partisan <- ifelse(all_data$Partij == "CDA" & all_data$elec_today == "CDA" | 
                              all_data$Partij == "CDA" & all_data$therm_cda > 6, 1, 0)

all_data$partisan <- ifelse(all_data$Partij == "GL" & all_data$elec_today == "GL" | 
                              all_data$Partij == "GL" & all_data$therm_gl > 6, 1, all_data$partisan)

all_data$partisan <- ifelse(all_data$Partij == "VVD" & all_data$elec_today == "VVD" | 
                              all_data$Partij == "VVD" & all_data$therm_vvd > 6, 1, all_data$partisan)

all_data$partisan <- ifelse(all_data$Partij == "PvdA" & all_data$elec_today == "PvdA" | 
                              all_data$Partij == "PvdA" & all_data$therm_pvda > 6, 1, all_data$partisan)

all_data$partisan <- ifelse(all_data$Partij == "PVV" & all_data$elec_today == "PVV" | 
                              all_data$Partij == "PVV" & all_data$therm_pvv > 6, 1, all_data$partisan)

all_data$partisan <- ifelse(all_data$Partij == "SP" & all_data$elec_today == "SP" | 
                              all_data$Partij == "SP" & all_data$therm_sp > 6, 1, all_data$partisan)



## Create an alternative variable for co-partisan or not
all_data$partisan_alt <- ifelse(all_data$Partij == "CDA" & all_data$therm_cda > 6, 1, 0)
all_data$partisan_alt <- ifelse(all_data$Partij == "GL" & all_data$therm_gl > 6, 1, all_data$partisan_alt)
all_data$partisan_alt <- ifelse(all_data$Partij == "VVD" & all_data$therm_vvd > 6, 1, all_data$partisan_alt)
all_data$partisan_alt <- ifelse(all_data$Partij == "PvdA" & all_data$therm_pvda > 6, 1, all_data$partisan_alt)
all_data$partisan_alt <- ifelse(all_data$Partij == "PVV" & all_data$therm_pvv > 6, 1, all_data$partisan_alt)
all_data$partisan_alt <- ifelse(all_data$Partij == "SP" & all_data$therm_sp > 6, 1, all_data$partisan_alt)




## Create an alternative variable for co-partisan or not
all_data$partisan_altelect <- ifelse(all_data$Partij == "CDA" & all_data$elec_today == "CDA", 1, 0)
table(all_data$partisan_altelect)
all_data$partisan_altelect <- ifelse(all_data$Partij == "GL" & all_data$elec_today == "GL", 1, all_data$partisan_altelect)
table(all_data$partisan_altelect)
all_data$partisan_altelect <- ifelse(all_data$Partij == "VVD" & all_data$elec_today == "VVD", 1, all_data$partisan_altelect)
table(all_data$partisan_altelect)
all_data$partisan_altelect <- ifelse(all_data$Partij == "PvdA" & all_data$elec_today == "PvdA", 1, all_data$partisan_altelect)
table(all_data$partisan_altelect)
all_data$partisan_altelect <- ifelse(all_data$Partij == "PVV" & all_data$elec_today == "PVV", 1, all_data$partisan_altelect)
table(all_data$partisan_altelect)
all_data$partisan_altelect <- ifelse(all_data$Partij == "SP" & all_data$elec_today == "SP", 1, all_data$partisan_altelect)
table(all_data$partisan_altelect)



## Create a continues variables for copartisan or not
all_data$therm_all <- ifelse(all_data$Partij == "CDA", all_data$therm_cda, 
                             ifelse(all_data$Partij == "VVD", all_data$therm_vvd,
                                    ifelse(all_data$Partij == "PvdA", all_data$therm_pvda,
                                           ifelse(all_data$Partij == "PVV", all_data$therm_pvv,
                                                  ifelse(all_data$Partij == "SP", all_data$therm_sp,
                                                         ifelse(all_data$Partij == "GL", all_data$therm_gl, NA))))))
anyNA(all_data$therm_all)
table(all_data$therm_all)

#write_rds(all_data, "data/final_data_wide_all_recoded.rds")

